<template>
  <el-dialog :title="'提现申请'" :close-on-click-modal="false" :visible.sync="visible">
    <div class="content">
      <div class="contentList">
        <div class="contentList">
          <div class="left">提现单位：</div>
          <div class="right">{{ nickname }}</div>
        </div>
        <div class="left">提现申请单号：</div>
        <div class="right">{{ balanceDateil.applyNo }}</div>
      </div>
      <div class="contentList">
        <div class="left">申请提现时间：</div>
        <div class="right">{{ timeone }}</div>
      </div>
      <div class="contentList">
        <div class="left">法人公司名称：</div>
        <div class="right">{{ balanceDateil.legalCompanyName }}</div>
      </div>
      <div class="contentList">
        <div class="left">申请提现金额：</div>
        <div class="right red">
          ￥{{ balanceDateil.applyFee | MoneyFormat }}
        </div>
      </div>
      <div class="contentList">
        <div class="left">提现审批时间：</div>
        <div class="right">{{ timetwo }}</div>
      </div>
      <div class="contentList">
        <div class="left">审批人：</div>
        <div class="right">{{ balanceDateil.approverFinanceName }}</div>
      </div>

      <div class="contentList">
        <div class="left">审批结果：</div>
        <div class="right">{{ status }}</div>
      </div>
      <div class="contentList" v-if="balanceDateil.agentStatus == '00'">
        <div class="left">提现订单编号：</div>
        <div class="right">{{ balanceDateil.orderNo }}</div>
      </div>
      <div class="contentList" v-if="balanceDateil.agentStatus == '00'">
        <div class="left">打款时间：</div>
        <div class="right">{{ timethree }}</div>
      </div>
      <div class="contentList" v-if="balanceDateil.agentStatus == '00'">
        <div class="left">银行名称：</div>
        <div class="right">{{ balanceDateil.bankAccountName }}</div>
      </div>
      <div class="contentList" v-if="balanceDateil.agentStatus == '00'">
        <div class="left">银行账户：</div>
        <div class="right">{{ balanceDateil.bankCardCode }}</div>
      </div>
      <div class="contentList">
        <div class="left">实际打款金额：</div>
        <div class="right red">
          ￥{{ balanceDateil.actualFee | MoneyFormat }}
        </div>
      </div>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="visible = false">关闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
import { formatDate } from "../../utils/time.js";
export default {
  data () {
    return {
      nickname: "",
      visible: false,
      timeone: "",
      timetwo: "",
      timethree: "",
      status: "",
      balanceDateil: {
        applyNo: "",
        applyTime: "",
        legalCompanyName: "",
        auditTime: "",
        approverFinanceName: "",
        applyFee: "",
        applyStatus: "",
        actualFee: "",

        bankCardCode: "",
        bankAccountName: "",
        orderNo: "",
        agentTime: "",
        agentStatus: "",
      },
    };
  },
  activated () {

  },
  methods: {
    init (cycleNo) {
      this.$http({
        url: this.$http.adornUrl(
          "cassadmin/balanceDetail/getCityWithdrawDetail"
        ),
        method: "get",
        params: this.$http.adornParams({
          cycleNo: cycleNo,
        }),
      }).then(({ data }) => {
        if (data.success == 1) {
          console.log(data);
          this.balanceDateil = data.data;
          if (this.balanceDateil.applyStatus == 0) {
            this.status = "审核中";
          } else if (this.balanceDateil.applyStatus == 1) {
            this.status = "审核通过";
          } else {
            this.status = "审核不通过";
          }
          if (this.balanceDateil.applyTime) {
            this.timeone = formatDate(
              this.balanceDateil.applyTime,
              "yyyy-MM-dd hh:mm"
            );
          }
          if (this.balanceDateil.auditTime) {
            this.timetwo = formatDate(
              this.balanceDateil.auditTime,
              "yyyy-MM-dd hh:mm"
            );
          }
          if (this.balanceDateil.agentTime) {
            this.timethree = formatDate(
              this.balanceDateil.agentTime,
              "yyyy-MM-dd hh:mm"
            );
          }
        } else {
          this.$message.error(data.errorMsg);
        }
      });

      this.visible = true;
    },
  },
};
</script>
<style scoped>
.content div {
  box-sizing: border-box;
}
.contentList {
  display: flex;
  padding: 20px;
}
.right {
  display: flex;
  flex: 1;
  justify-content: flex-end;
}
.red {
  color: #ff6600;
  font-weight: 600;
}
</style>
